package com.ruoyi.common.core.domain.entity;

import com.ruoyi.common.core.domain.BaseEntity;

import java.util.ArrayList;
import java.util.List;

public class EchartData extends BaseEntity {
    private List<DataItem> dataItems;
    private Object total;

    public Object getTotal() {
        return total;
    }

    public void setTotal(Object total) {
        this.total = total;
    }

    public EchartData() {
        this.dataItems = new ArrayList<>();
    }

    public void addDataItem(String name, Object value) {
        this.dataItems.add(new DataItem(name, value));
    }

    public List<DataItem> getDataItems() {
        return dataItems;
    }

    public void setDataItems(List<DataItem> dataItems) {
        this.dataItems = dataItems;
    }

    public static class DataItem {
        private String name;
        private Object value;


        public DataItem(String name, Object value) {
            this.name = name;
            this.value = value;
        }


        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public Object getValue() {
            return value;
        }

        public void setValue(Object value) {
            this.value = value;
        }
    }
}
